<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<title>信用综合评价系统</title>
<link href="/css/login/login.css" th:href="@{/css/login/login.css}"
	rel="stylesheet">
</head>
<body>
	<div class="logo"></div>
	<form id="signupForm" method="post" class="login-form">
		<div class="main">
			<input id="username" type="text" name="username" placeholder="请输入账号"  autocomplete="off"/> 
			<input id="password" type="password" name="password" placeholder="请输入密码"  autocomplete="off"/>
			<input type="button" name="login" value="登录" onclick="userLogin()" />
		</div>
	</form>
	<div id="footer" class="footer">建设单位：陕西鼎业征信有限公司<br/>技术支持：上海三零卫士信息安全有限公司</div>
	
	<script th:inline="javascript"> var ctx = [[@{/}]] ; </script>
	<script src="/js/jquery.min.js?v=2.1.4"
		th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
	<script src="/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
	<script src="/js/plugins/layer/layer.min.js"
		th:src="@{/js/plugins/layer/layer.min.js}"></script>
	<script type="text/javascript">
		$(document).keyup(function(event){
		    if(event.keyCode ==13){
		    	userLogin();
		    }
		});
		function userLogin() {
			if ("" == $("#username").val()) {
				layer.msg('请输入用户名');
				return;
			}
			if ("" == $("#password").val()) {
				layer.msg('请输入密码');
				return;
			}
			$.ajax({
				type : "POST",
				url : ctx + "login",
				data : $('#signupForm').serialize(),
				success : function(r) {
					if (r.code == 0) {
						parent.location.href = ctx + 'index';
					} else {
						layer.msg(r.msg);
					}
				},
			});
		}
	</script>
</body>
</html>